home *** CD-ROM | disk | FTP | other *** search
-
- #include <Folders.h>
-
- #include "syslog.h"
-
- void InitToolbox(void);
-
- // Disable to create an application that logs restarts or shutdowns (not crashes)
- #if 1
- #define STARTUP
- #endif
-
- void InitToolbox(void){
- InitGraf(&qd.thePort);
- InitFonts();
- FlushEvents(everyEvent, 0);
- InitWindows();
- InitMenus();
- TEInit();
- InitDialogs(0L);
- InitCursor();
- MaxApplZone();
- }
-
- void main(void){
- FSSpec spec;
- OSErr err;
- short vref;
- long dirid;
-
- InitToolbox();
-
- FindFolder(kOnSystemDisk,kSystemFolderType,kCreateFolder,&vref,&dirid);
- FSMakeFSSpec(vref,dirid,"\pSystem Activity Log",&spec);
-
- setsyslogfile(&spec);
-
- #ifdef STARTUP
- syslog(LOG_INFO,"System Startup");
- #else
- syslog(LOG_INFO,"System Shutdown");
- #endif
- }